package com.weipai.education.dao.impl;

import com.weipai.education.dao.ProductCateDao;
import com.weipai.education.mapper.ProductCateMapper;
import com.weipai.education.model.ProductCate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @Author: 曹朋飞
 * @Date: 2018/12/11 11:21
 */
@Repository
public class ProductCateDaoImpl implements ProductCateDao {
    
    @Autowired
    private ProductCateMapper productCateMapper;


    @Override
    public List<Map<String, Object>> list(Integer start, Integer size) {
        return productCateMapper.list(start, size);
    }

    @Override
    public Integer listAmount() {
        return productCateMapper.listAmount();
    }

    @Override
    public int update(ProductCate productCate) {
        return productCateMapper.updateByPrimaryKeySelective(productCate);
    }

    @Override
    public int insert(ProductCate productCate) {
        return productCateMapper.insert(productCate);
    }

    @Override
    public ProductCate selectByPrimaryKey(String id) {
        return productCateMapper.selectByPrimaryKey(Integer.parseInt(id));
    }

    @Override
    public int batchDeleteById(String[] id) {
        return productCateMapper.batchDeleteById(id);
    }

    @Override
    public ProductCate selectByProductId(Integer productId) {
        return productCateMapper.selectByProductId(productId);
    }
}
